package cc.vv.btpartyjob.jobactivities.adapter

import android.widget.ImageView
import android.widget.TextView
import cc.vv.baselibrary.adapter.SimpleCommonAdapter
import cc.vv.baselibrary.adapter.holder.ExtendViewHolder
import cc.vv.btpartyjob.jnimodule.server.OperationServer
import cc.vv.btpartyjob.jobactivities.R
import cc.vv.btpartyjob.jobactivities.moudel.bean.ZhiBuActivitiesBean
import cc.vv.lkimagecomponent2.LKImage
import cc.vv.lkimagecomponent2.lib.mode.ScaleMode

/**
 * 支部活动dapter
 * Created by Chen.qi on 2018/10/24.
 */
class PartyBranchActivitiesAdapter(layoutResId: Int) : SimpleCommonAdapter<ZhiBuActivitiesBean>(layoutResId) {
    override fun convert(helper: ExtendViewHolder, item: ZhiBuActivitiesBean, position: Int) {
        val picUrl = ""
        LKImage.load().load(picUrl).placeHolder(R.mipmap.icon_item_pic_zbhd).error(R.mipmap.icon_item_pic_zbhd)
                .scale(ScaleMode.CENTER_CROP).into(helper.getView<ImageView>(R.id.iv_isyL_itemPic))


        //title
        helper.getView<TextView>(R.id.tv_isyL_listTitle)?.text = item.title
        //创建时间
        helper.getView<TextView>(R.id.tv_isyL_createTime)?.text = OperationServer.formatStr(item.createTime)
    }
}